#!/usr/bin/env python
import pygame, math
import particles, resource_manager, ship

class Raider(ship.Ship):
    ACC = 0.2
    MAX_SPEED = 10
    TURN = 6.5
    _image = resource_manager.load_image('cylon.png')[0]
    def __init__(self, controller = None):
        self.rect = self._image.get_rect()
        ship.Ship.__init__(self, controller)

    def fire_prim(self, delta = 1): # primary fire
        if(pygame.time.get_ticks() > self.next_prim):
            b_speed = (self.speed[0] + (15 * math.cos(math.radians(self.heading))),\
                       self.speed[1] + (15 * math.sin(math.radians(self.heading))))
            
            f = math.radians(self.heading - 20)            
            p1 = (self.position[0] + (15 * math.cos(f)),\
                  self.position[1] + (15 * math.sin(f)))
            
            f = math.radians(self.heading + 20)
            p2 = (self.position[0] + (15 * math.cos(f)),\
                  self.position[1] + (15 * math.sin(f)))
            
            ship.Bullet(self, b_speed, p1)
            ship.Bullet(self, b_speed, p2)
            self.next_prim = pygame.time.get_ticks() + 100
            
    def hit(self, by):
        pass
    def killed(self, by):
        pass

